

<table width="100%">
	<tr>
		<td width="15%"><?php echo CHtml::image(Yii::app()->request->baseUrl.'/images/logo.png'); ?></td>
		<td width="85%">
		<h4><strong>PT. ANUGERAH BERSAMA BERKAH ABADI</strong></h4>
		<h4><strong>STATISTIC</strong></h4>
		</td>
	</tr>
</table>

<?php for($i=0;$i<count($data);$i++){ ?>
	<?php	if($data[$i]['jns_mata_uang'] == 'Rupiah'){ ?>
			<?php $isi .= "
			<tr>
				<td>".$data[$i]['name']."</td>
				<td>".$data[$i]['jns_insurance']."</td>
				<td>".$data[$i]['jns_mata_uang']."</td>
				<td align='right'>".number_format($data[$i]['gross_premi'])."</td>
				<td align='right'>".number_format($data[$i]['brokerage'])."</td>
				<td>0</td>
				<td>0</td>
			</tr> ";
			 ?>
			<?php $total_debet_rp += $data[$i]['debet']; ?>
			<?php $total_kredit_rp += $data[$i]['kredit']; ?>
	<?php }else if($data[$i]['jns_mata_uang'] == 'Dollar'){ ?>	
			<?php $isi_dollar .= "
			<tr>
				<td>".$data[$i]['name']."</td>
				<td>".$data[$i]['jns_insurance']."</td>
				<td>".$data[$i]['jns_mata_uang']."</td>
				<td align='right'>".number_format($data[$i]['gross_premi'])."</td>
				<td align='right'>".number_format($data[$i]['brokerage'])."</td>
				<td>0</td>
				<td>0</td>
			</tr> ";
			 ?>
			<?php $total_debet_dolar += $data[$i]['debet']; ?>
			<?php $total_kredit_dolar += $data[$i]['kredit']; ?>
	<?php }else if($data[$i]['jns_mata_uang'] == 'Euro'){ ?>
			<?php $isi_euro .= "
			<tr>
				<td>".$data[$i]['name']."</td>
				<td>".$data[$i]['jns_insurance']."</td>
				<td>".$data[$i]['jns_mata_uang']."</td>
				<td align='right'>".number_format($data[$i]['gross_premi'])."</td>
				<td  align='right'>".number_format($data[$i]['brokerage'])."</td>
				<td>0</td>
				<td>0</td>
			</tr> ";
			 ?>
			<?php $total_debet_euro += $data[$i]['debet']; ?>
			<?php $total_kredit_euro += $data[$i]['kredit']; ?>
	<?php }else{} } ?>
	
	<div class="form">
Rupiah
<br/>
<table border="1">
	<thead>
		<tr>
			<th style="text-align:center" rowspan="2">Client Name</th>
			<th style="text-align:center" rowspan="2">Type Of Insurance</th>
			<th style="text-align:center" rowspan="2">Currency</th>
			<th style="text-align:center" colspan="2">Current Period</th>
			<th style="text-align:center" colspan="2">Last Year Same Period</th>
		</tr>
		<tr>
			<th style="text-align:center">Gross Premium</th>
			<th style="text-align:center">Brokerage</th>
			<th style="text-align:center">Gross Premium</th>
			<th style="text-align:center">Brokerage</th>
		</tr>
	</thead>
	<tbody id="body_rupiah">
		<?=$isi?>
				
	</tbody>
</table>
	
</div>
		
		
		<div class="form">
Dolar
<br/>
<table border="1">
	<thead>
		<tr>
			<th style="text-align:center" rowspan="2">Client Name</th>
			<th style="text-align:center" rowspan="2">Type Of Insurance</th>
			<th style="text-align:center" rowspan="2">Currency</th>
			<th style="text-align:center" colspan="2">Current Period</th>
			<th style="text-align:center" colspan="2">Last Year Same Period</th>
		</tr>
		<tr>
			<th style="text-align:center">Gross Premium</th>
			<th style="text-align:center">Brokerage</th>
			<th style="text-align:center">Gross Premium</th>
			<th style="text-align:center">Brokerage</th>
		</tr>
	</thead>
	<tbody id="body_dolar">
			<?=$isi_dollar?>
				
	</tbody>
</table>
	
</div>
			
				
				<div class="form">
Euro
<br/>
<table border="1">
	<thead>
		<tr>
			<th style="text-align:center" rowspan="2">Client Name</th>
			<th style="text-align:center" rowspan="2">Type Of Insurance</th>
			<th style="text-align:center" rowspan="2">Currency</th>
			<th style="text-align:center" colspan="2">Current Period</th>
			<th style="text-align:center" colspan="2">Last Year Same Period</th>
		</tr>
		<tr>
			<th style="text-align:center">Gross Premium</th>
			<th style="text-align:center">Brokerage</th>
			<th style="text-align:center">Gross Premium</th>
			<th style="text-align:center">Brokerage</th>
		</tr>
	</thead>
		<tbody id="body_euro">
				<?=$isi_euro?>
				
	</tbody>
</table>
	
</div>
			
		
